<?
/*

    This file is part of Blue Violin.

    Blue Violin is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Blue Violin is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero Public License for more details.

    You should have received a copy of the GNU Affero Public License
    along with Blue Violin.  If not, see <http://www.gnu.org/licenses/>.

    Blue Violin  Copyright (C) 2008  Blue Violin, Inc. & Josh Watts <josh.watts@blueviolin.org>
	For more information, visit http://www.blueviolin.org/

    This program comes with ABSOLUTELY NO WARRANTY.

*/

require_once("../general.php");
require_once("../classes/Security.php");
require_once("../classes/BVScripts.php");
session_start();

error_log("loading page");


$oSecurity = new Security();
$bReturningUser = $oSecurity->CheckCookie();
if (false == $bReturningUser)
{
	$oSecurity->CreateLogin();
}
$sAccountMessage = "";
$sLoginButton = "";
$oSecurity->Destruct();

$oBVScript = new BVScripts();
$sUsername = $oBVScript->CheckLogin();
$sMenuLoginMsg = "";
if ("" != $sUsername &&
	"%!$@#" != $sUsername)
{
	$sMenuLoginMsg = $sUsername;
}
else
{
	// $sMenuLoginMsg = "Sign On";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xsi:schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"
	  xml:lang="en" >

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
		<link rel="stylesheet" href="css/app.css" type="text/css"/>
		<script src="scripts/json.js">
		</script>
		<script src="scripts/exceptions.js">
		</script>
		<script src="scripts/general.js">
		</script>
		<script src="scripts/WindowResizer.js">
		</script>		
		<script src="scripts/menu.js">
		</script>
		<script src="scripts/toolbar.js">
		</script>
		<script src="scripts/appevents.js">
		</script>
		<script src="scripts/replay.js">
		</script>
		<script src="scripts/BVReport.js">
		</script>
		<script src="scripts/popuptabs.js">
		</script>
		<script src="scripts/actiontree.js">
		</script>
		<script src="scripts/login.js">
		</script>
		<script src="scripts/Profiles.js">
		</script>
		<script src="scripts/Screenshots.js">
		</script>
		<script>
			window.loginMessage = "<?= $sMenuLoginMsg ?>";
		</script>
	</head>
	<body id="bodyMain" unselectable="on" onload="BodyLoad()">
		
		<span id="spnLogo" class="AppLogo">
			<img src="images/app_logo.gif" class="AppLogoImage"/>
		</span>
		<div id="divMenu" class="Menu">

			<div class="TopRound">
				<span class="FloatLeftHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/left_top.gif" style="float: left;"/>
				</span>
				<span class="FloatRightHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/right_top.gif" style="float: right;"/>
				</span>
			</div>

			<div id="divMenuBar" class="MenuBar">

				<span id="spnMenuLogin" class="MenuLogin" >

					<span id="spnMenuLoginMessage" class="LoginMessage">
					</span>

					<span id="spnLoginAccount">
						Email: 
						<input type="text" id="txtUser" class="TextBox" />
						Password:
						<input type="password" id="txtPassword" class="TextBox" />
						<!-- <input type="button" value="Login" class="Button" /> -->
					</span>

					<button id="btnMenuLogin" class="Button" style="margin-left: 3px;">
						Login
					</button>

					<span id="spnCreateAccount">
						or
						<button id="btnMenuCreate" class="Button" style="margin-left: 3px;">
							Create Account
						</button>
					</span>

				</span>



				<span id="spnMenuBarProfile" class="MenuItem" toplevel="true">
					Profile
					<ul>
						<li id="liNewProfile">
							New Profile
						</li>
						<li id="liOpenProfile">
							Open Profile
						</li>
						<li id="liEditProfile">
							Edit Profile
						</li>
					</ul>
				</span>

				<span id="spnMenuBarTesting" class="MenuItem" toplevel="true">
					Testing
					<ul>
						<li id="liNewScript">
							New Script
						</li>
						<li id="liOpenScript">
							Open Script
						</li>
						<li id="liSaveScript">
							Save Script
						</li>
						<li style="height: 5px; padding: 0px;">
							<hr noshade/>
						</li>
						<li id="liReplay">
							Replay
						</li>
						<li style="height: 5px; padding: 0px;">
							<hr noshade/>
						</li>
						<li id="liTestScreenshot">
							Test Screenshot
						</li>						
					</ul>
				</span>

				<span id="spnMenuBarReporting" class="MenuItem" toplevel="true">
					Reporting
					<ul>
						<li id="liViewReport">
							View Report
						</li>
						<li id="liHistoricalReport">
							Past Replay Results
						</li>

						
					</ul>
				</span>

				<span id="spnMenuLoginProfile" class="Profile">
				</span>


			</div>


			<div class="BottomRound">
				<span class="FloatLeftHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/left_bottom.gif" style="float: left;"/>
				</span>
				<span class="FloatRightHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/right_bottom.gif" style="float: right;"/>
				</span>
			</div>

		</div>


		<!-- toolbar -->
		<div id="divToolbar" class="Toolbar">

			<div class="TopRound">
				<span class="FloatLeftHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/left_top.gif" style="float: left;"/>
				</span>
				<span class="FloatRightHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/right_top.gif" style="float: right;"/>
				</span>
			</div>
			
			<div class="ToolbarStrip">
				<button id="btnToolbarBack" disabled>
					<img src="./images/toolbar/back_24_disabled.gif" id="imgToolbarBack"/>
				</button>
				<button id="btnToolbarForward" disabled>
					<img src="./images/toolbar/forward_24_disabled.gif" id="imgToolbarForward"/>
				</button>
				<button id="btnToolbarStop">
					<img src="./images/toolbar/stop_24_normal.gif" id="imgToolbarStop"/>
				</button>
				<button id="btnToolbarRefresh">
					<img src="./images/toolbar/refresh_24_normal.gif" id="imgToolbarRefresh"/>
				</button>
				<button id="btnToolbarHome">
					<img src="./images/toolbar/home_24_normal.gif" id="imgToolbarHome"/>
				</button>
				<button id="btnToolbarRecord">
					<img src="./images/toolbar/pause_24_normal.gif" id="imgToolbarRecord" />
				</button>
				<input type="text" id="txtToolbarAddress" title="Enter a URL to load" class="Address"/>
				<button id="btnToolbarOK" >
					<img src="./images/toolbar/go_24_normal.gif" id="imgToolbarOK" />
				</button>

			</div>

			<div class="BottomRound">
				<span class="FloatLeftHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/left_bottom.gif" style="float: left;"/>
				</span>
				<span class="FloatRightHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/right_bottom.gif" style="float: right;"/>
				</span>
			</div>

		</div>

		<div id="divPopupTabsContainer" class="PopupTabsContainer">

			<div class="TopRound">
				<span class="FloatLeftHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/left_top.gif" style="float: left;"/>
				</span>
				<span class="FloatRightHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/right_top.gif" style="float: right;"/>
				</span>
			</div>

			<div id="divPopupTabs" class="PopupTabs">

				<span id="spnMainBrowser" class="PopupTabsSpan" style="color: white;">
					<span id="spnInner" >
						Main Browser
					</span>
				</span>

			</div>

			<div class="BottomRound">
				<span class="FloatLeftHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/left_bottom.gif" style="float: left;"/>
				</span>
				<span class="FloatRightHalfWidth">
					<img width="5" height="5" src="./images/backgrounds/right_bottom.gif" style="float: right;"/>
				</span>
			</div>

		</div>

		<div id="divWorkspace" class="Workspace">

			<span id="spnActionTree" class="ActionTree">
				<ol id="ulTree">
				</ol>
			</span>

			<span id="spnBrowsers" class="IEBrowsers">
				<div id="divMainBrowser">
 					<object id="objMainBrowser" classid="clsid:B8C1C27C-E637-422A-A2DA-05176750AEBE" class="IEBrowser">
 					</object>
				</div>
			</span>

		</div>

		<div id="divReport" class="Report">
			<div
				id="divReportTitle"
				class="ReportTitle"
				>
				<button
					id="btnCloseReport"
					class="ReportCloseButton"
					>
					<img
						src="images/toolbar/close_red_16_hot.gif"
						/>
				</button>
				<span id="spnReportTitleMessage" >
				</span>
			</div>

			<div id="divHistory" class="HistoricalReport">
				<div id="divHistoryItems" class="HistoryItems">
				</div>
			</div>

			<div id="divReplayResults">
				<div 
					id="divReportHeader"
					class="ReportHeader"
					>

					<div id="divResult">
						<span id="spnResultLabel" class="ReportHeaderRunDate">
							Result
						</span>
						<span id="spnResultMessage">
						</span>
						<img id="imgResult" src="./images/reports/green_round_16_n.gif" border="0" style="margin-left: 3px; vertical-align: middle;"/>
					</div>
					


					<div 
						id="divRunDate"
						>
						<span
							id="spnRunDateLabel"
							class="ReportHeaderRunDate"
							>
							Run Date
						</span>
						<span
							id="spnRunDateMessage"
							>
						</span>
					</div>
					
					<div
						id="divElapsedTime"
						>
						
						<span
							id="spnElapsedTimeLabel"
							class="ReportHeaderRunDate"
							>
							Elapsed Time
						</span>
						<span id="spnElapsedTimeMessage">
						</span>

					</div>

				</div>
				<table
					id="tblReport"
					cellpadding="0"
					cellspacing="0"
					class="ReportTable"
					>
				</table>
			</div>
		</div>


		<div id="divBrowserSnapshot" class="BrowserSnapshot">
			<img id="imgBrowserSnapshot" />
		</div>

		<input type="hidden" id="hdnReplay" value="false" />





	</body>
</html>



